# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models
from django.contrib.auth.models import AbstractUser

# Create your models here.

class UserProfile(AbstractUser):
    nick_name = models.CharField(u'昵称', max_length=50, default=u'')
    gender = models.CharField(u'性别', choices=(
        ('male', u'男'), ('female', u'女')), default='male', max_length=6)
    birday = models.DateField(u'生日', null=True, blank=True)
    mobile = models.CharField(u'手机', max_length=11, null=True, blank=True)
    address = models.CharField(u'地址', max_length=100, null=True, blank=True)
    type = models.IntegerField(u'类型', default='5')
    age = models.IntegerField(u'年龄', null=True, blank=True)
    id_card = models.CharField(u'身份证',max_length=18,null=True, blank=True)
    # image = models.ImageField(u'头像', upload_to='img/%Y/%m', default='img/default.jpg', max_length=100)

    class Meta(AbstractUser.Meta):
        verbose_name = u'用户信息'
        verbose_name_plural = verbose_name

    def __unicode__(self):
        return self.username

RantPartition = {
    1: '钻石会员',
    2: '白金会员',
    3: '黄金会员',
    4: '普通会员'
}

class Customer(models.Model):
    name = models.CharField(max_length=50)
    gender = models.CharField(u'性别', choices=(
        ('male', u'男'), ('female', u'女')), default='male', max_length=6)
    mobile = models.CharField(u'手机', max_length=11, null=True, blank=True)
    id_card = models.CharField(u'身份证',max_length=18,null=True, blank=True)
    rant = models.IntegerField(u'会员等级', default='4')